<?php
 include "counter2.php";

pagestart();
print "<html>\n";
?>
<?php pagehead(_("Client Scripts")) ?>
<BODY bgcolor="white">
<?php pagetop(_("Client Scripts")) ?>

<?php print _("This section contains scripts that can be run on a Linux box to ease the task of registering with the Linux Counter, and of keeping a registration up to date.") ?>

<h2><?php print _("Machine Update") ?></h2>
<strong><?php print _("NOTE: This script DOES NOT UPDATE THE COUNTER YET") ?></strong>. <?php print _("The data is stored, and will be merged later, but until the script is better tested, it is not copied to the main counter.") ?>
<p>
<?php print _("This script registers or updates a machine's info in the counter.") ?>
<p>
<?php print _("Instructions for use:") ?>
<ul>
<li><?php print _("Save") ?> <a href="machine-update"><?php print _("machine-update") ?></a> <?php print _("to a file named \"machine-update\" in any convenient place") ?>
<li><?php print _("From a terminal window, change directory to that place.") ?>
<li><?php print _("Change it to be executable (chmod +x machine-update)") ?>
<li><?php print _("Run \"./machine-update -i\" to enter information") ?>
<li><?php print _("Run \"./machine-update -m\" to send mail") ?>
<li><?php print _("Run \"./machine-update -c\" to add it to your crontab file") ?>
</ul>
<?php print _("YOU DO NOT NEED TO RUN THIS AS ROOT. Running it as \"any random user\" is MUCH better practice. The user ID must only be able to send mail and write to its own home directory.") ?>
<p>
<?php print _("Here's what running machine-update -i looks like:") ?>
<pre>

prompt> machine-update -i
 Here you can specify some info that the script can't know for itself
 Your Linux Counter reg#, if any [2]: 
 Your machine's counter reg#, if any [2345]:
 Here is what the program has found:
 bogomips   : 35.84
 accounts   : 8
 name       : dokka.maxware.no
 kernel     : 2.0.35
 users      : 0
 cpu        : 586/90 (bogo 586)
 memory     : 48
 mailer     : sendmail
 disk       : 1851
 Do you want to override some of the found values? [no]:
 --------------------------------------------------------
 This is what will be sent to the Linux Counter if you run
 the program with the -m switch. Now, NOTHING IS SENT
 --------------------------------------------------------
 From: hta
 To: machine-registration@counter.li.org
 Subject: machine-update for dokka.maxware.no

 //MACHINE
 accounts: 8
 bogomips: 35.84
 cpu: 586/90 (bogo 586)
 disk: 1851
 kernel: 2.0.35
 key: 2345
 mailer: sendmail
 memory: 48
 method: machine-update version 0.09
 name: dokka.maxware.no
 owner: 2
 uniqueid: 290176264
 uptime: 45 days, 2:22
 users: 0
 //END
prompt>

</pre>
<?php print _("All the info sent to the counter is also stored in the file \"$HOME/.linuxcounter/&lt;machine&gt;\". You can edit the info you entered by hand by running \"machine-update -i\".") ?>
<p>
<?php print _("If you have any trouble, mail the program's output, the top few lines of the script, and any files in $HOME/.linuxcounter to") . emailCloaking("Harald@Alvestrand.no",0)?>
<p>
<?php print _("For the truly adventorous, there's always a") ?> <a href="machine-update-beta"><?php print _("beta version") ?></a> <?php print _("available.") ?>
<p>
<?php print _("Happy updating!") ?>

<?php pagebottom("yes") ?>
</body>
</html>

